import request from '@/utils/request'

export default {
  //查询权限
  selectPermissionList(pagination) {
    return request({
      url: "/rbac/permission/list",
      method: "get",
      params: pagination
    })
  },
  //删除权限
  deletePermission(id) {
    return request({
      url: "/rbac/permission/delete",
      method: "post",
      params: {id}
    })
  },
  //更新权限信息
  updatePermission(data) {
    return request({
      url: "/rbac/permission/update",
      method: "post",
      data
    })
  },
  //添加权限
  addPermission(data) {
    return request({
      url: '/rbac/permission/add',
      method: 'post',
      data
    })
  },
  //根据id查询权限
  selectPermissionById(id) {
    return request({
      url: "/rbac/permission/selectById",
      method: "get",
      params: {id}
    })
  },
  //查询所有权限
  selectAll(){
    return request({
      url: "/rbac/permission/selectAll",
      method: "get",
    })
  },
  selectTreeList(){
    return request({
      url: "/rbac/permission/selectTreeList",
      method: "get",
    })
  }
}
